#include "Block.h"

CBlock::CBlock()
{
	m_count = 0;
	m_size = 10;
	m_statements = new CStatement*[m_size];
}

CBlock::~CBlock()
{
	delete[] m_statements;
}

void CBlock::addStatement(CStatement *statement)
{
	if (m_count >= m_size)
	{
		CStatement **tmp = new CStatement*[m_size + 10];
		for (int i=0;i<m_size;i++)
			tmp[i] = m_statements[i];
		m_size += 10;
		delete[] m_statements;
		m_statements = tmp;
	}

	m_statements[m_count++] = statement;
}
